{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}

<PopupMenu @name="alias-menu">
  {{#let (get this.params "0") as |item|}}
    <nav class="menu">
      <ul class="menu-list">
        <li class="action">
          <LinkTo
            @route="vault.cluster.access.identity.aliases.show"
            @models={{array (pluralize item.parentType) item.id "details"}}
          >
            Details
          </LinkTo>
        </li>
        {{#if item.updatePath.isPending}}
          <li class="action">
            <LoadingDropdownOption />
          </li>
        {{else}}
          {{#if item.canEdit}}
            <li class="action">
              <LinkTo
                @route="vault.cluster.access.identity.aliases.edit"
                @models={{array (pluralize item.parentType) item.id}}
              >
                Edit
              </LinkTo>
            </li>
          {{/if}}
          {{#if item.canDelete}}
            <ConfirmAction
              @buttonText="Delete"
              @isInDropdown={{true}}
              @onConfirmAction={{action "performTransaction" item}}
              data-test-item-delete
            />
          {{/if}}
        {{/if}}
      </ul>
    </nav>
  {{/let}}
</PopupMenu>